package org.dahuatech.ssh.action.role;

import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.dahuatech.ssh.entity.account.Role;
import org.dahuatech.ssh.service.organization.OrganizationManager;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
@InterceptorRefs({  
	@InterceptorRef("defaultInterceporStack")
})
public class RoleAction extends ActionSupport {
	
	private String organiztionTreeJson;
	
	private Role entity;
	
	@Autowired
	private OrganizationManager organizationManager;
	
	@Override
	public String execute() throws Exception {
		organiztionTreeJson=organizationManager.listAllOrganizationJson();
		return ActionSupport.SUCCESS;
	}

	public void setOrganiztionTreeJson(String organiztionTreeJson) {
		this.organiztionTreeJson = organiztionTreeJson;
	}

	public String getOrganiztionTreeJson() {
		return organiztionTreeJson;
	}

	public void setEntity(Role entity) {
		this.entity = entity;
	}

	public Role getEntity() {
		return entity;
	}
}
